// pages/commit/commit.js
//获取应用实例
const app = getApp()
var util= require("../../utils/libs.js");
var api = require("../../utils/api.js");
var date = require("../../utils/date.js");
Page({
  data: {
    id:null,
    value:"",
    uid:null,
    content:"",
    page:0,
    limit:10, 
    commits: [],
  },
  editP: function () {
    wx.navigateTo({
      url: '../groups/groups',
    })
  },
  onLoad(options){
    let that = this
    var uid = wx.getStorageSync('uid')
    that.setData({
      id:options.id,
      uid:uid
    })
    that.articleList()
  },
  articleList(){
    let that = this
    util.request(api.commentList,{
      id:that.data.id,
      uid:that.data.uid,
      page:that.data.page,
      limit:that.data.limit 
    },"GET")
    .then(function (res) {
      if(res.error_code === 0){
        that.setData({
            commits:res.data.list 
        })
      }
    })
  },
  goSend(){
    let that = this
     wx.navigateTo({
         url:"/pages/sendTo/sendTo?id="+that.data.id
     })
  }
})
